package cn.mynb.util;

import java.util.List;

public class PageModel {

	/**
	 * 总数量
	 */
	private int total ;
	
	/**
	 * 总页数
	 */
	private int maxPageNo ;
	
	/**
	 * 每页显示多少条数据
	 */
	private int pageSize ;
	
	/**
	 * 获得查询的数据
	 */
	@SuppressWarnings("unchecked")
	private List pageData ;

	/**
	 * 计算页数
	 * @return
	 */
	public int getMaxPageNo() {
		
		if(total % pageSize == 0) {
			maxPageNo = total/pageSize ;
		} else {
			maxPageNo = (total/pageSize)+1 ;
		}
		return maxPageNo ;
	}
	
	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public void setMaxPageNo(int maxPageNo) {
		this.maxPageNo = maxPageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	@SuppressWarnings("unchecked")
	public List getPageData() {
		return pageData;
	}

	@SuppressWarnings("unchecked")
	public void setPageData(List pageData) {
		this.pageData = pageData;
	}
	
	
}
